<?php
require_once 'Validation.php';
require_once 'test.php';
$validation = new Validation();
$test = new Test();
?>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Seminarie 2</title>
</head>

<body>
<?php
// Email test;
$errors = $test->EmailTest($validation);
if(empty($errors)) {	
	echo "<p>Validation successful.</p>";	
}
else {
	foreach ($errors as $error => $value) {
		echo $value;
	}
}


// SSN test
$errors = $test->SocialsecurityTest($validation);
if(empty($errors)) {	
	echo "<p>Validation successful.</p>";	
}
else {
	foreach ($errors as $error => $value) {
		echo $value;
	}
}

// Date test
$errors = $test->DateTest($validation);
if(empty($errors)) {	
	echo "<p>Validation successful.</p>";	
}
else {
	foreach ($errors as $error => $value) {
		echo $value;
	}
}

// String test HTML
if($test->StringTestHTML($validation)) {
	echo "<p>Validation successful.</p>";
} else {
	echo "<p>Validation failed.</p>";
}

// String test Non HTML
if($test->StringTestNonHTML($validation)) {
	echo "<p>Validation successful.</p>";
} else {
	echo "<p>Validation failed.</p>";
}

// Test av Password
$errors = $test->PasswordTest($validation); 
if(empty($errors)) {	
	echo "<p>Validation successful.</p>";	
}
else {
	foreach ($errors as $error => $value) {
		echo $value;
	}
}

// Test av nummer
$errors = $test->NumberTest($validation);
if(empty($errors)) {	
	echo "<p>Validation successful.</p>";	
}
else {
	foreach ($errors as $error => $value) {
		echo $value;
	}
}
?>
</body>
</html>